@echo off
setlocal EnableDelayedExpansion
set ROOT_DIR=%~dp0
net session >nul 2>&1
if "!errorlevel!" equ "0" (
  goto:UninstallUsAsAdministrator
) else (
  goto:UninstallByCMD 
)
exit


:UninstallByCMD
cscript //nologo %ROOT_DIR%\base\Elevate.vbs %ROOT_DIR%\entry_uninstall.bat
echo "Succeed to uninstall WSS(Windows Script Set), press any key to exit this cmd windows."
pause
exit
goto:eof


:UninstallUsAsAdministrator
set WSS_HOME=
setx WSS_HOME "" >nul
setx WSS_HOME "" /M >nul
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor" /v AutoRun /f
goto:eof